Android improvements needed for building NumPy and related packages#2695
Android improvements needed for building NumPy and related packages#2695
Conversation
|
Is there anything you'd like to pull out and get in for the next version? |
|
Not at the moment, thanks. |
* Set up Android env after installing pkgconf * Add tests for successfully using an older API level * Previous commit's auditwheel failure is fixed in the auditwheel PR
|
@mayeut: Since you're familiar with pypa/auditwheel#643, it might make sense for you to review this PR as well. It won't be ready to merge until the auditwheel work has been released, but it's otherwise complete. |
| "x86_64": "x86_64-linux-android", | ||
| } | ||
|
|
||
| CROSS_BUILD_FILES = { |
There was a problem hiding this comment.
I think this shall go in the configuration in order to allow users to extend/override without the need for a new cibuildwheel version.
There was a problem hiding this comment.
I've added an xbuild-files option, named that way for consistency with xbuild-tools.
| setup_rust(config, python_dir, android_env) | ||
|
|
||
| # Create shims which install additional build tools on first use. | ||
| setup_fortran(android_env) |
There was a problem hiding this comment.
Do we really want to maintain this ? Should it be an example instead ?
Fortran is not setup for Windows & macOS and it's up to projects using it to set it up, however they choose to do it.
There was a problem hiding this comment.
If it was simple to install the Android Fortran compiler then I would agree, but as you can see from the shim, it involves a complex merge of files from several different sources. The code to do this should be centralized somewhere, and cibuildwheel seems like the obvious choice, since it's already responsible for installing the other Android compilers (done by the android.py env command, which ultimately runs this script).
Fortran is a slow-moving language, so I don't expect this code will need to change very often. For example, previously I was using the Fortran compiler from GCC 4.9, which was released in 2014, but was still able to build SciPy 1.8.1, which was released in 2022.
Fixes for several issues found while building NumPy and related packages for Android:
Replace the limited built-in
repair-wheel-commandwith full auditwheel support.Add a shim which installs a Fortran compiler on demand, using a similar approach as we did for Rust.
Set up pkgconf in the build environment, and enable PKG_CONFIG_RELOCATE_PATHS. This is necessary for Meson, which uses pkgconf to find Python.
When a package builds against NumPy, replace platform-specific files with their Android equivalents, using a similar approach to pyodide-build.
This PR branch is temporarily used by several other PRs: see the cross-references below.